Eclipse JDT
Pre-release 3.0

org.eclipse.jdt.core.search
Class SearchParticipant

java.lang.Object
  extended byorg.eclipse.jdt.core.search.SearchParticipant

public abstract class SearchParticipant
extends Object

A search participant describes a particular extension to a generic search mechanism, permitting combined search actions which will involve all required participants. A search scope defines which participants are involved. A search participant is responsible for holding index files, and selecting the appropriate ones to feed to index queries. It also can map a document path to an actual document (note that documents could live outside the workspace or not exist yet, and thus aren't just resources).

Since:
3.0

Field Summary
static SearchParticipant[] NO_PARTICIPANT
           
 
Constructor Summary
SearchParticipant()
           
 
Method Summary
static void addIndexEntry(char[] category, char[] key, SearchDocument document, String indexPath)
           
abstract  void beginSearching()
          Intermediate notification sent when a given participant is getting involved.
abstract  void doneSearching()
          Intermediate notification sent when a given participant is finished to be involved.
abstract  String getDescription()
          Returns a displayable name of this search participant.
abstract  SearchDocument getDocument(String documentPath)
          Bind a document path to an actual document.
abstract  void indexDocument(SearchDocument document, String indexPath)
          Index the given document.
abstract  void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor)
          Locate the matches in the given documents and report them using the search requestor.
static void removeAllIndexEntries(String documentPath, String indexPath)
           
 void scheduleDocumentIndexing(SearchDocument document, String containerPath, String indexPath)
          Schedules the indexing of the given document.
abstract  IPath[] selectIndexes(SearchPattern query, IJavaSearchScope scope)
          Returns the collection of index paths to consider when performing a given search query in a given scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PARTICIPANT

public static final SearchParticipant[] NO_PARTICIPANT
Constructor Detail

SearchParticipant

public SearchParticipant()
Method Detail

addIndexEntry

public static void addIndexEntry(char[] category,
                                 char[] key,
                                 SearchDocument document,
                                 String indexPath)

removeAllIndexEntries

public static void removeAllIndexEntries(String documentPath,
                                         String indexPath)

beginSearching

public abstract void beginSearching()
Intermediate notification sent when a given participant is getting involved.


doneSearching

public abstract void doneSearching()
Intermediate notification sent when a given participant is finished to be involved.


getDescription

public abstract String getDescription()
Returns a displayable name of this search participant. e.g. "Java".


getDocument

public abstract SearchDocument getDocument(String documentPath)
Bind a document path to an actual document. A document path is interpreted by a participant.


indexDocument

public abstract void indexDocument(SearchDocument document,
                                   String indexPath)
Index the given document. Implementation should call addIndexEntry(...) TODO (jerome) improve spec


locateMatches

public abstract void locateMatches(SearchDocument[] indexMatches,
                                   SearchPattern pattern,
                                   IJavaSearchScope scope,
                                   SearchRequestor requestor,
                                   IProgressMonitor monitor)
                            throws CoreException
Locate the matches in the given documents and report them using the search requestor. Note: allows to combine match locators (e.g. jsp match locator can preprocess jsp unit contents and feed it to Java match locator asking for virtual matches by contributing document implementations which do the conversion). It is assumed that virtual matches are rearranged by requestor for adapting line/source positions before submitting final results so the provided searchRequestor should intercept virtual matches and do appropriate conversions.

Throws:
CoreException

scheduleDocumentIndexing

public void scheduleDocumentIndexing(SearchDocument document,
                                     String containerPath,
                                     String indexPath)
Schedules the indexing of the given document. Once the document is ready to be indexed, indexDocument(SearchDocument) is called.


selectIndexes

public abstract IPath[] selectIndexes(SearchPattern query,
                                      IJavaSearchScope scope)
Returns the collection of index paths to consider when performing a given search query in a given scope.


Eclipse JDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.